﻿@model sheego.Framework.Presentation.Web.Models.Deployment

@{
    ViewBag.Title = "Edit deployment";
}

<h2>@ViewBag.Title</h2>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true, "", new { @class = "text-danger" })

    <!-- Text input-->
    <div class="form-group row">
        @Html.LabelFor(model => model.Name, new { @class = "col-md-2 control-label" })
        <div class="col-md-4">
            @Html.DisplayFor(model => model.Name, new { @class = "form-control input-md" })
            @Html.HiddenFor(model => model.Name)
        </div>
    </div>

    <!-- Textarea -->
    <div class="form-group row">
        @Html.LabelFor(model => model.Description, new { @class = "col-md-2 control-label", @for = "textarea" })
        <div class="col-md-4">
            @Html.EditorFor(model => model.Description, new { placeholder = "Enter release description", @class = "form-control input-md" })
        </div>
    </div>

    <!-- Due Date-->
    <div class="form-group row">
        @Html.LabelFor(model => model.DueDate, new { @class = "col-md-2 control-label", @for = "date" })
        <div class="col-md-4">
            @Html.EditorFor(model => model.DueDate) <!-- ToDo: Change text to something generic -->
        </div>
    </div>

    <hr />
    <p>
        <h4>Deployment environment</h4>
        <div class="form-group row">
            <div class="col-md-8">
            @*Environments drop down list*@
            @Html.DropDownListFor(model => model.Environment, Model.Environments, "Select environment", new { @class = "col-md-4" })
            </div>
        </div>
    </p>

    <hr />
    <p>
        <h4>Release version</h4>
        <div class="form-group row">
            <div class="col-md-8">
            @*Releases drop down list*@
            @Html.DropDownListFor(model => model.ReleaseVersion, Model.ReleaseVersions, "Select release version", new { @class = "col-md-4" })
            </div>
        </div>
    </p>

    <!-- Buttons -->
    <div class="form-group row">
        <div class="col-md-2">
            <button name="action" value="save" class="btn btn-primary">Save</button>
        </div>
        <div class="col-md-2 col-md-offset-2">
            <button name="action" value="confirmdeployment" class="btn btn-primary">Confirm deployment</button>
        </div>
    </div>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

